<!DOCTYPE html>
<!--声明Thymeleaf语法-->
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>第3方授权登录页</title>
</head>

<body>

<a id="login">Login with GitHub</a>
<a id="loginGitee">Login with Gitee</a>

<script th:inline="javascript">
    <!--要放在html下面才生效-->
    const client_id = [[${clientIdGitee}]];
    const redirect_uri = [[${redirectUri}]];
    const authorize_uri = 'https://github.com/login/oauth/authorize';

    const link = document.getElementById('login');
    console.log(link)
    link.href = `${authorize_uri}?client_id=${client_id}&redirect_uri=${redirect_uri}`;


    const clientIdGitee = [[${clientIdGitee}]];
    const redirect_uri_gitee = [[${redirectUriGitee}]];
    const authorize_uri_gitee = 'https://gitee.com/oauth/authorize';

    const linkGitee = document.getElementById('loginGitee');
    console.log(linkGitee)
    linkGitee.href = `${authorize_uri_gitee}?client_id=${clientIdGitee}&redirect_uri=${redirect_uri_gitee}&response_type=code&state=1`;
</script>
</body>

</html>